#if 0
#include "Input.h"
#include "Requirements.h"
namespace NBE
{
	LONG InputController::MOUSE_X;
	LONG InputController::MOUSE_Y;
	std::unordered_map<int, bool> InputController::keyMap; 

	Mouse::Mouse( HWND hwnd):m_hWnd(hwnd)
	{
		assert(hwnd != NULL);
		// Initialize buttons to "up".
		//
		for( ButtonId button=0; button<MAX_BUTTONS; ++button)
		{
			m_buttonStates[ button ] = false;
			m_lastButtonStates[ button ] = false;
		}

	}
	unsigned int Mouse::getNumButtons() const
	{
		return MAX_BUTTONS;
	}
	vec2f Mouse::getPosition() const
	{
		POINT mousePos;
		GetCursorPos(&mousePos);
		ScreenToClient(m_hWnd,&mousePos);
		return vec2f(static_cast<float>(mousePos.x),static_cast<float>(mousePos.y));
	}
	bool Mouse::didGoUp( ButtonId button) const
	{
		assert( button < getNumButtons() );
		return !m_buttonStates[ button ] && m_lastButtonStates[ button ];
	}
	bool Mouse::didGoDown( ButtonId button ) const
	{
		assert( button < getNumButtons() );
		return m_buttonStates[ button ] && !m_lastButtonStates[ button ];
	}
	bool Mouse::isDown( ButtonId button ) const
	{
		assert( button< getNumButtons());
		return m_buttonStates[ button ];
	}

	void Mouse::ProcessMessages(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
	{
		switch( message )
		{
		case WM_LBUTTONDOWN:
			m_buttonStates[0] = true;
			break;
		case WM_LBUTTONUP:
			m_buttonStates[0] = false;
			break;
		case WM_RBUTTONDOWN:
			m_buttonStates[1] = true;
			break;
		case WM_RBUTTONUP:
			m_buttonStates[1] = false;
			break;
		case WM_MBUTTONDOWN:
			m_buttonStates[2] = true;
			break;
		case WM_MBUTTONUP:
			m_buttonStates[2] = false;
			break;
		}
	}
	Mouse& GetTheMouse(HWND hWnd)
	{
		static Mouse mouse(hWnd);
		return mouse;
	}

	void Mouse::updateState()
	{
		for( ButtonId button=0; button<MAX_BUTTONS; ++button)
		{
			m_lastButtonStates[ button ] = m_buttonStates[ button ];
		}
	}

	

}
#endif

#include "Event.h"
#include "Input.h"
#include <algorithm>
namespace NBE
{
	Input::Input(InputType t):m_inputType(t)
	{}
	unsigned int Input::addEvent(Event* theEvent)
	{
		m_eventQue.push(theEvent);
		return m_eventQue.size() - 1; //return index
	}
	void Input::handleAllEvents()
	{
		while(m_eventQue.size()>0)
		{
			Event* e = m_eventQue.front();
			for(size_t i = 0; i< m_listener.size(); ++i)
			{
				m_listener[i]->handleEvent(e);
				
			}
			delete e;
			m_eventQue.pop();
		}
	}

	void Input::registerListener(Listener* lsn)
	{
		m_listener.push_back(lsn);
	}

	void Input::unRegisterListener(Listener* _lsn)
	{
		for(auto it = m_listener.begin(); it != m_listener.end(); ++it)
		{
			if(*it == _lsn)
			{
				m_listener.erase(it);
				break;
			}
		}
		
	}
}